-module(lib_misc).
-compile(export_all).

sum(L) -> sum(L, 0).
sum([], N) -> N;
sum([H|T], N) -> sum(T,H+N).

for(Max, Max, F) -> [F(Max)];
for (I, Max, F) -> [F(I)|for(I+1, Max , F)].

